﻿<%@ Page Title="Сфери  діяльності" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Sections.aspx.cs" Inherits="Work.UI.Web.Forms.Admin.Section.Sections" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="contentHeader" runat="server">
Сфери  діяльності
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <asp:ObjectDataSource ID="odsSection" runat="server" 
        onobjectcreating="odsSection_ObjectCreating"
        TypeName="Work.BL.Hibernate.Managers.HSectionManager"
        DataObjectTypeName="Work.BL.POCOs.SectionPOCO" 
        StartRowIndexParameterName="startIndex"
        MaximumRowsParameterName="maxCount"       
        SelectCountMethod="GetSectionCount"
        SelectMethod="GetSections"
        DeleteMethod="Delete"
        EnablePaging="true">
        <deleteparameters>
            <asp:parameter name="Id" type="Int32" />
          </deleteparameters>
    </asp:ObjectDataSource>

    <asp:GridView ID="grvSection" runat="server"
        DataSourceID="odsSection" AutoGenerateColumns="false"
        AllowPaging="true" PageSize="10" AllowSorting="true"
        CssClass="GridViewStyle" DataKeyNames="Id" OnRowDeleted="grvSection_OnRowDeleted">
        <FooterStyle CssClass="GridViewFooterStyle" />
        <RowStyle CssClass="GridViewRowStyle" />    
        <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
        <PagerStyle CssClass="GridViewPagerStyle" />
        <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
        <HeaderStyle CssClass="GridViewHeaderStyle" />

        <Columns>
            <asp:TemplateField HeaderText="#">
                <ItemTemplate>
                    <%# Eval("Id") %>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Name">
                <ItemTemplate>
                    <%# Eval("Name") %>
                </ItemTemplate>
            </asp:TemplateField>


            <asp:TemplateField HeaderText="">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# "~/Admin/Section/Edit.aspx?Id=" + Eval("Id") %>'>Edit</asp:HyperLink>
                    &nbsp;|&nbsp;
                    <asp:LinkButton ID="LinkButton1" CommandName="Delete"  runat="server"
                     OnClientClick="return confirm('Are you certain you want to delete this section?');">
                    Delete</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>

        </Columns>

    </asp:GridView>

    <asp:LinkButton ID="lnkInsertProject" runat="server" 
        onclick="btnInsert_Click" CssClass="button1"><strong>Add New</strong></asp:LinkButton>

</asp:Content>
